home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / tkern10.zip / GNUISH\PATCHES < prev    next >
Text File  |  1990-09-19  |  25KB  |  746 lines

  1. diff -c DOS/error.c GNU/error.c
  2. *** DOS/error.c    Thu Sep 20 00:19:04 1990
  3. --- GNU/error.c    Thu Sep 20 00:19:48 1990
  4. ***************
  5. *** 45,55 ****
  6.   #else
  7.   void exit ();
  8.   
  9. - #ifdef MSDOS
  10. - /* Force consistency of the prototypes.  */
  11. - #include <gnulib.h>
  12. - #endif
  13.   static char *
  14.   strerror (errnum)
  15.        int errnum;
  16. --- 45,50 ----
  17. diff -c DOS/getopt.c GNU/getopt.c
  18. *** DOS/getopt.c    Thu Sep 20 00:19:02 1990
  19. --- GNU/getopt.c    Thu Sep 20 00:19:40 1990
  20. ***************
  21. *** 14,26 ****
  22.      You should have received a copy of the GNU General Public License
  23.      along with this program; if not, write to the Free Software
  24.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  25. - /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  26. -    This port is distributed under the terms of the GNU General
  27. -    Public License as published by the Free Software Foundation.
  28. -    $Header: e:/gnu/lib/RCS/getopt.c 1.1.0.1 90/09/11 09:46:00 tho Exp $
  29. -  */
  30.   
  31.   #ifdef __STDC__
  32.   #define CONST const
  33. --- 14,19 ----
  34. ***************
  35. *** 51,62 ****
  36.   #ifdef sparc
  37.   #include <alloca.h>
  38.   #else
  39. - #ifdef MSDOS
  40. - #include <malloc.h>
  41. - #else
  42.   char *alloca ();
  43.   #endif
  44. - #endif
  45.   #endif /* not __GNUC__ */
  46.   
  47.   #if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__)
  48. --- 44,51 ----
  49. ***************
  50. *** 79,91 ****
  51.   char *malloc ();
  52.   #endif
  53.   
  54. - #ifdef MSDOS
  55. - /* Include the <getopt.h> header file to insure consistency
  56. -    of the prototypes.  */
  57. - #include <getopt.h>
  58. - static void exchange (char **argv);
  59. - #endif /* MSDOS */
  60.   /* For communication from `getopt' to the caller.
  61.      When `getopt' finds an option that takes an argument,
  62.      the argument value is returned here.
  63. --- 68,73 ----
  64. ***************
  65. *** 156,166 ****
  66.     REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
  67.   } ordering;
  68.   
  69. - /* We have included <getopt.h>, so we'd better not redefine
  70. -    struct option.  */
  71. - #ifndef MSDOS
  72.   /* Describe the long-named options requested by the application.
  73.      _GETOPT_LONG_OPTIONS is a vector of `struct option' terminated by an
  74.      element containing a name which is zero.
  75. --- 138,143 ----
  76. ***************
  77. *** 174,180 ****
  78.     int *flag;
  79.     int val;
  80.   };
  81. - #endif /* not MSDOS */
  82.   
  83.   CONST struct option *_getopt_long_options;
  84.   
  85. --- 151,156 ----
  86. diff -c DOS/glob.c GNU/glob.c
  87. *** DOS/glob.c    Thu Sep 20 00:19:06 1990
  88. --- GNU/glob.c    Thu Sep 20 00:19:52 1990
  89. ***************
  90. *** 14,26 ****
  91.      You should have received a copy of the GNU General Public License
  92.      along with this program; if not, write to the Free Software
  93.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  94. - /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  95. -    This port is distributed under the terms of the GNU General
  96. -    Public License as published by the Free Software Foundation.
  97. -    $Header: e:/gnu/lib/RCS/glob.c 1.0.0.3 90/09/19 22:50:58 tho Exp $
  98. -  */
  99.   
  100.   /* To whomever it may concern: I have never seen the code which most
  101.      Unix programs use to perform this function.  I wrote this from scratch
  102. --- 14,19 ----
  103. ***************
  104. *** 79,99 ****
  105.   #ifdef sparc
  106.   #include <alloca.h>
  107.   #else /* Not sparc.  */
  108. - #ifdef MSDOS
  109. - #include <malloc.h>
  110. - #else
  111.   extern char *alloca ();
  112. - #endif
  113.   #endif /* sparc.  */
  114.   #endif /* GCC.  */
  115.   
  116. - #ifdef MSDOS
  117. - #include <gnulib.h>
  118. - static  int glob_match_after_star(char *,char *);
  119. - static  char * *glob_dir_to_array(char *,char **);
  120. - #endif /* MSDOS */
  121. -   
  122.   /* Nonzero if '*' and '?' do not match an initial '.' for glob_filename.  */
  123.   int noglob_dot_filenames = 1;
  124.   
  125. --- 72,81 ----
  126. ***************
  127. *** 331,342 ****
  128.         dp = readdir (d);
  129.         if (dp == NULL)
  130.       break;
  131. - #ifdef MSDOS    /* dp->d_ino is always 0 in the MS-DOS implementation. */
  132. -       if (glob_match (pat, dp->d_name, noglob_dot_filenames))
  133. - #else
  134.         if (dp->d_ino != 0
  135.         && glob_match (pat, dp->d_name, noglob_dot_filenames))
  136. - #endif /* MSDOS */
  137.       {
  138.         nextlink = (struct globval *) alloca (sizeof (struct globval));
  139.         nextlink->next = lastlink;
  140. --- 313,320 ----
  141. ***************
  142. *** 570,579 ****
  143.   }
  144.   
  145.   #ifdef TEST
  146. - #ifdef MSDOS
  147. - #include <stdio.h>
  148. - #endif
  149.   
  150.   main (argc, argv)
  151.        int argc;
  152. --- 548,553 ----
  153. diff -c DOS/regex.c GNU/regex.c
  154. *** DOS/regex.c    Thu Sep 20 00:19:32 1990
  155. --- GNU/regex.c    Thu Sep 20 00:20:06 1990
  156. ***************
  157. *** 15,27 ****
  158.      along with this program; if not, write to the Free Software
  159.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  160.   
  161. - /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  162. -    This port is distributed under the terms of the GNU General
  163. -    Public License as published by the Free Software Foundation.  */
  164.   
  165. - static char RCSid[] =
  166. -    "$Header: e:/gnu/lib/RCS/regex.c 1.1.0.1 90/09/11 09:24:43 tho Exp $";
  167.   /* To test, compile with -Dtest.  This Dtestable feature turns this into
  168.      a self-contained program which reads a pattern, describes how it
  169.      compiles, then reads a string and searches for it.
  170. --- 15,21 ----
  171. ***************
  172. *** 58,122 ****
  173.   char *realloc ();
  174.   #endif
  175.   
  176. - #ifdef MSDOS
  177. - /* At the moment these macros are used for shutting up the compiler, but
  178. -    one day we might support really 'huge' regular expressions.
  179. -    Also we should check for wrap-arounds in the near models.  */
  180. - #if defined (_MSC_VER) && (_MSC_VER >= 600)
  181. - #define HUGE _huge
  182. - #else /* _MSC_VER < 600 */
  183. - #define HUGE huge
  184. - #endif /* _MSC_VER < 600 */
  185. - #if defined (M_I86CM) || defined (M_I86LM) 
  186. - #define PTR_DIFF(ptr1,ptr2) \
  187. -   ((long)((char HUGE *)(ptr1) - (char HUGE *)(ptr2)))
  188. - #else
  189. - /* After changing ALLOCATED to size_t for the small and medium model,
  190. -    we could remove the cast to long.  */
  191. - #define PTR_DIFF(ptr1,ptr2)    ((long)((ptr1) - (ptr2)))
  192. - #endif
  193. - /* The second argument to xrealloc:  */
  194. - #define SIZE_T size_t
  195. - /* The 80[12]?86 are always in danger of stack overflow.  So better check
  196. -    the success of each alloca ().  */
  197. - #define TEST_ALLOCA(ptr) \
  198. -   if (ptr==NULL)                              \
  199. -     {                                      \
  200. -       fprintf (stderr, "Stack overflow: %s, l.%d\n", __FILE__, __LINE__); \
  201. -       abort ();                                  \
  202. -     }
  203. - #else /* not MSDOS */
  204. - #define PTR_DIFF(ptr1,ptr2)    ((ptr1) - (ptr2))
  205. - #define SIZE_T int
  206. - #define TEST_ALLOCA(ptr)
  207. - #endif /* not MSDOS */
  208. - #ifdef MSDOS
  209. - /* Since  sizeof (int) != sizeof (void *) in the compact and large models,
  210. -    we'd better provide prototypes.  */
  211. - static    int bcmp_translate (unsigned char *s1, unsigned char *s2, int len,
  212. -                 unsigned char *translate);
  213. - static    void init_syntax_once (void);
  214. - static    void insert_jump (char op, char *from, char *to, char *current_end);
  215. - static    void insert_jump_n (char op, char *from, char *to, char *current_end,
  216. -                 unsigned int n);
  217. - static    void insert_op_2 (char op, char *there, char *current_end, int num_1,
  218. -               int num_2);
  219. - static    void store_jump (char *from, char opcode, char *to);
  220. - static    void store_jump_n (char *from, char opcode, char *to, unsigned int n);
  221. - #endif /* MSDOS */
  222.   /* Make alloca work the best possible way.  */
  223.   #ifdef __GNUC__
  224.   #define alloca __builtin_alloca
  225. --- 52,57 ----
  226. ***************
  227. *** 124,136 ****
  228.   #ifdef sparc
  229.   #include <alloca.h>
  230.   #else
  231. - #ifdef MSDOS
  232. - #include <malloc.h>
  233. - #else
  234.   char *alloca ();
  235.   #endif
  236.   #endif
  237. - #endif
  238.   
  239.   
  240.   /* Define the syntax stuff, so we can do the \<, \>, etc.  */
  241. --- 59,67 ----
  242. ***************
  243. *** 291,305 ****
  244.    
  245.   
  246.   /* Store NUMBER in two contiguous bytes starting at DESTINATION.  */
  247. - #ifdef MSDOS            /* This is to shut up the compiler.  */
  248. - #define STORE_NUMBER(destination, number)                \
  249. -   { (destination)[0] = (char) ((number) & 0377);            \
  250. -     (destination)[1] = (char) ((number) >> 8); }
  251. - #else /* not MSDOS */
  252.   #define STORE_NUMBER(destination, number)                \
  253.     { (destination)[0] = (number) & 0377;                    \
  254.       (destination)[1] = (number) >> 8; }
  255. - #endif /* not MSDOS */
  256.     
  257.   /* Same as STORE_NUMBER, except increment the destination pointer to
  258.      the byte after where the number is stored.  Watch out that values for
  259. --- 222,230 ----
  260. ***************
  261. *** 330,340 ****
  262.      The argument SYNTAX is a bit-mask comprised of the various bits
  263.      defined in regex.h.  */
  264.   
  265. ! LONG
  266.   re_set_syntax (syntax)
  267. !   LONG syntax;
  268.   {
  269. !   LONG ret;
  270.   
  271.     ret = obscure_syntax;
  272.     obscure_syntax = syntax;
  273. --- 255,265 ----
  274.      The argument SYNTAX is a bit-mask comprised of the various bits
  275.      defined in regex.h.  */
  276.   
  277. ! int
  278.   re_set_syntax (syntax)
  279. !   int syntax;
  280.   {
  281. !   int ret;
  282.   
  283.     ret = obscure_syntax;
  284.     obscure_syntax = syntax;
  285. ***************
  286. *** 342,348 ****
  287.   }
  288.   
  289.   /* Set by re_set_syntax to the current regexp syntax to recognize.  */
  290. ! LONG obscure_syntax = 0;
  291.   
  292.   
  293.   
  294. --- 267,273 ----
  295.   }
  296.   
  297.   /* Set by re_set_syntax to the current regexp syntax to recognize.  */
  298. ! int obscure_syntax = 0;
  299.   
  300.   
  301.   
  302. ***************
  303. *** 372,378 ****
  304.   /* Make sure we have at least N more bytes of space in buffer.  */
  305.   #define GET_BUFFER_SPACE(n)                        \
  306.     {                                        \
  307. !     while (PTR_DIFF (b, bufp->buffer) + (n) >= bufp->allocated)        \
  308.         EXTEND_BUFFER;                            \
  309.     }
  310.   
  311. --- 297,303 ----
  312.   /* Make sure we have at least N more bytes of space in buffer.  */
  313.   #define GET_BUFFER_SPACE(n)                        \
  314.     {                                        \
  315. !     while (b - bufp->buffer + (n) >= bufp->allocated)            \
  316.         EXTEND_BUFFER;                            \
  317.     }
  318.   
  319. ***************
  320. *** 382,397 ****
  321.       GET_BUFFER_SPACE (1);                        \
  322.       *b++ = (char) (ch);                            \
  323.     }
  324. ! #ifdef MSDOS
  325. ! /* We could (if we payed more attention to signed/unsigned issues)
  326. !    increase MAX_ALLOC to (1L<<15).  But we will do only *after* we've
  327. !    actually hit this limit!  */
  328. ! #define MAX_ALLOC    (1L<<14)
  329. ! #else /* not MSDOS */
  330. ! #define MAX_ALLOC    (1L<<16)
  331. ! #endif /* not MSDOS */
  332.   /* Extend the buffer by twice its current size via reallociation and
  333.      reset the pointers that pointed into the old allocation to point to
  334.      the correct places in the new allocation.  If extending the buffer
  335. --- 307,313 ----
  336.       GET_BUFFER_SPACE (1);                        \
  337.       *b++ = (char) (ch);                            \
  338.     }
  339. !   
  340.   /* Extend the buffer by twice its current size via reallociation and
  341.      reset the pointers that pointed into the old allocation to point to
  342.      the correct places in the new allocation.  If extending the buffer
  343. ***************
  344. *** 398,407 ****
  345.      results in it being larger than 1 << 16, then flag memory exhausted.  */
  346.   #define EXTEND_BUFFER                            \
  347.     { char *old_buffer = bufp->buffer;                    \
  348. !     if (bufp->allocated == MAX_ALLOC) goto too_big;            \
  349.       bufp->allocated *= 2;                        \
  350. !     if (bufp->allocated > MAX_ALLOC) bufp->allocated = MAX_ALLOC;    \
  351. !     bufp->buffer = (char *) realloc (bufp->buffer, (SIZE_T) bufp->allocated); \
  352.       if (bufp->buffer == 0)                        \
  353.         goto memory_exhausted;                        \
  354.       b = (b - old_buffer) + bufp->buffer;                \
  355. --- 314,323 ----
  356.      results in it being larger than 1 << 16, then flag memory exhausted.  */
  357.   #define EXTEND_BUFFER                            \
  358.     { char *old_buffer = bufp->buffer;                    \
  359. !     if (bufp->allocated == (1L<<16)) goto too_big;            \
  360.       bufp->allocated *= 2;                        \
  361. !     if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16);        \
  362. !     bufp->buffer = (char *) realloc (bufp->buffer, bufp->allocated);    \
  363.       if (bufp->buffer == 0)                        \
  364.         goto memory_exhausted;                        \
  365.       b = (b - old_buffer) + bufp->buffer;                \
  366. ***************
  367. *** 717,723 ****
  368.           case '[':
  369.             if (p == pend)
  370.               goto invalid_pattern;
  371. !       while (PTR_DIFF (b , bufp->buffer)
  372.            > bufp->allocated - 3 - (1 << BYTEWIDTH) / BYTEWIDTH)
  373.           EXTEND_BUFFER;
  374.   
  375. --- 633,639 ----
  376.           case '[':
  377.             if (p == pend)
  378.               goto invalid_pattern;
  379. !       while (b - bufp->buffer
  380.            > bufp->allocated - 3 - (1 << BYTEWIDTH) / BYTEWIDTH)
  381.           EXTEND_BUFFER;
  382.   
  383. ***************
  384. *** 802,808 ****
  385.                 if (c == ':' || c == ']' || p == pend
  386.                             || c1 == CHAR_CLASS_MAX_LENGTH)
  387.                   break;
  388. !               str[c1++] = (char) c;
  389.               }
  390.             str[c1] = '\0';
  391.             if (p == pend     
  392. --- 718,724 ----
  393.                 if (c == ':' || c == ']' || p == pend
  394.                             || c1 == CHAR_CLASS_MAX_LENGTH)
  395.                   break;
  396. !               str[c1++] = c;
  397.               }
  398.             str[c1] = '\0';
  399.             if (p == pend     
  400. ***************
  401. *** 1387,1393 ****
  402.        struct re_pattern_buffer *bufp;
  403.   {
  404.     unsigned char *pattern = (unsigned char *) bufp->buffer;
  405. !   LONG size = bufp->used;
  406.     register char *fastmap = bufp->fastmap;
  407.     register unsigned char *p = pattern;
  408.     register unsigned char *pend = pattern + size;
  409. --- 1303,1309 ----
  410.        struct re_pattern_buffer *bufp;
  411.   {
  412.     unsigned char *pattern = (unsigned char *) bufp->buffer;
  413. !   int size = bufp->used;
  414.     register char *fastmap = bufp->fastmap;
  415.     register unsigned char *p = pattern;
  416.     register unsigned char *pend = pattern + size;
  417. ***************
  418. *** 1813,1819 ****
  419.           stackx = (unsigned char **) alloca (2 * MAX_NUM_FAILURE_ITEMS    \
  420.                               * (stacke - stackb)        \
  421.                                               * sizeof (unsigned char *));\
  422. -     TEST_ALLOCA (stackx);                        \
  423.       /* Only copy what is in use.  */                \
  424.           bcopy (stackb, stackx, (stackp - stackb) * sizeof (char *));    \
  425.       stackp = stackx + (stackp - stackb);                \
  426. --- 1729,1734 ----
  427. ***************
  428. *** 2348,2355 ****
  429.           register unsigned char *p1 = p + mcnt;
  430.           /* p1[0] ... p1[2] are an on_failure_jump.
  431.              Examine what follows that.  */
  432. !         if (p1[3] == (unsigned char) exactn
  433. !             && p1[5] != (unsigned char) c)
  434.             p[-3] = (unsigned char) finalize_jump;
  435.           else if (p1[3] == (unsigned char) charset
  436.                || p1[3] == (unsigned char) charset_not)
  437. --- 2263,2269 ----
  438.           register unsigned char *p1 = p + mcnt;
  439.           /* p1[0] ... p1[2] are an on_failure_jump.
  440.              Examine what follows that.  */
  441. !         if (p1[3] == (unsigned char) exactn && p1[5] != c)
  442.             p[-3] = (unsigned char) finalize_jump;
  443.           else if (p1[3] == (unsigned char) charset
  444.                || p1[3] == (unsigned char) charset_not)
  445. ***************
  446. *** 2765,2775 ****
  447.   
  448.     /* Allow a command argument to specify the style of syntax.  */
  449.     if (argc > 1)
  450. - #ifdef MSDOS
  451. -     obscure_syntax = atol (argv[1]);
  452. - #else /* not MSDOS */    
  453.       obscure_syntax = atoi (argv[1]);
  454. - #endif /* not MSDOS */        
  455.   
  456.     buf.allocated = 40;
  457.     buf.buffer = (char *) malloc (buf.allocated);
  458. --- 2679,2685 ----
  459. diff -c DOS/regex.h GNU/regex.h
  460. *** DOS/regex.h    Thu Sep 20 00:19:10 1990
  461. --- GNU/regex.h    Thu Sep 20 00:19:56 1990
  462. ***************
  463. *** 16,40 ****
  464.      along with this program; if not, write to the Free Software
  465.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  466.   
  467. - /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  468. -    This port is distributed under the terms of the GNU General
  469. -    Public License as published by the Free Software Foundation.
  470.   
  471. -    $Header: e:/gnu/lib/RCS/regex.h 1.1.0.1 90/09/11 09:24:51 tho Exp $
  472. -  */
  473.   #ifdef __GNUC__
  474.     #pragma once
  475.   #endif
  476.   
  477. - #ifdef MSDOS
  478. - #define LONG long
  479. - #define ONE 1L
  480. - #else /* not MSDOS */
  481. - #define LONG int
  482. - #define ONE 1
  483. - #endif /* not MSDOS */
  484.   #ifndef __REGEXP_LIBRARY
  485.   #define __REGEXP_LIBRARY
  486.   
  487. --- 16,26 ----
  488. ***************
  489. *** 52,58 ****
  490.   
  491.   
  492.   /* This defines the various regexp syntaxes.  */
  493. ! extern LONG obscure_syntax;
  494.   
  495.   
  496.   /* The following bits are used in the obscure_syntax variable to choose among
  497. --- 38,44 ----
  498.   
  499.   
  500.   /* This defines the various regexp syntaxes.  */
  501. ! extern int obscure_syntax;
  502.   
  503.   
  504.   /* The following bits are used in the obscure_syntax variable to choose among
  505. ***************
  506. *** 62,86 ****
  507.        parentheses are needed for literal searching.
  508.      If not set, backslash-parentheses are grouping, and plain parentheses
  509.        are for literal searching.  */
  510. ! #define RE_NO_BK_PARENS    ONE
  511.   
  512.   /* If this bit is set, plain | serves as the `or'-operator, and \| is a 
  513.        literal.
  514.      If not set, \| serves as the `or'-operator, and | is a literal.  */
  515. ! #define RE_NO_BK_VBAR (ONE << 1)
  516.   
  517.   /* If this bit is not set, plain + or ? serves as an operator, and \+, \? are 
  518.        literals.
  519.      If set, \+, \? are operators and plain +, ? are literals.  */
  520. ! #define RE_BK_PLUS_QM (ONE << 2)
  521.   
  522.   /* If this bit is set, | binds tighter than ^ or $.
  523.      If not set, the contrary.  */
  524. ! #define RE_TIGHT_VBAR (ONE << 3)
  525.   
  526.   /* If this bit is set, then treat newline as an OR operator.
  527.      If not set, treat it as a normal character.  */
  528. ! #define RE_NEWLINE_OR (ONE << 4)
  529.   
  530.   /* If this bit is set, then special characters may act as normal
  531.      characters in some contexts. Specifically, this applies to:
  532. --- 48,72 ----
  533.        parentheses are needed for literal searching.
  534.      If not set, backslash-parentheses are grouping, and plain parentheses
  535.        are for literal searching.  */
  536. ! #define RE_NO_BK_PARENS    1
  537.   
  538.   /* If this bit is set, plain | serves as the `or'-operator, and \| is a 
  539.        literal.
  540.      If not set, \| serves as the `or'-operator, and | is a literal.  */
  541. ! #define RE_NO_BK_VBAR (1 << 1)
  542.   
  543.   /* If this bit is not set, plain + or ? serves as an operator, and \+, \? are 
  544.        literals.
  545.      If set, \+, \? are operators and plain +, ? are literals.  */
  546. ! #define RE_BK_PLUS_QM (1 << 2)
  547.   
  548.   /* If this bit is set, | binds tighter than ^ or $.
  549.      If not set, the contrary.  */
  550. ! #define RE_TIGHT_VBAR (1 << 3)
  551.   
  552.   /* If this bit is set, then treat newline as an OR operator.
  553.      If not set, treat it as a normal character.  */
  554. ! #define RE_NEWLINE_OR (1 << 4)
  555.   
  556.   /* If this bit is set, then special characters may act as normal
  557.      characters in some contexts. Specifically, this applies to:
  558. ***************
  559. *** 90,139 ****
  560.      If this bit is not set, special characters (such as *, ^, and $)
  561.      always have their special meaning regardless of the surrounding
  562.      context.  */
  563. ! #define RE_CONTEXT_INDEP_OPS (ONE << 5)
  564.   
  565.   /* If this bit is not set, then \ before anything inside [ and ] is taken as 
  566.        a real \.
  567.      If set, then such a \ escapes the following character.  This is a
  568.        special case for awk.  */
  569. ! #define RE_AWK_CLASS_HACK (ONE << 6)
  570.   
  571.   /* If this bit is set, then \{ and \} or { and } serve as interval operators.
  572.      If not set, then \{ and \} and { and } are treated as literals.  */
  573. ! #define RE_INTERVALS (ONE << 7)
  574.   
  575.   /* If this bit is not set, then \{ and \} serve as interval operators and 
  576.        { and } are literals.
  577.      If set, then { and } serve as interval operators and \{ and \} are 
  578.        literals.  */
  579. ! #define RE_NO_BK_CURLY_BRACES (ONE << 8)
  580.   
  581.   /* If this bit is set, then character classes are supported; they are:
  582.        [:alpha:],    [:upper:], [:lower:],  [:digit:], [:alnum:], [:xdigit:],
  583.        [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
  584.      If not set, then character classes are not supported.  */
  585. ! #define RE_CHAR_CLASSES (ONE << 9)
  586.   
  587.   /* If this bit is set, then the dot re doesn't match a null byte.
  588.      If not set, it does.  */
  589. ! #define RE_DOT_NOT_NULL (ONE << 10)
  590.   
  591.   /* If this bit is set, then [^...] doesn't match a newline.
  592.      If not set, it does.  */
  593. ! #define RE_HAT_NOT_NEWLINE (ONE << 11)
  594.   
  595.   /* If this bit is set, back references are recognized.
  596.      If not set, they aren't.  */
  597. ! #define RE_NO_BK_REFS (ONE << 12)
  598.   
  599.   /* If this bit is set, back references must refer to a preceding
  600.      subexpression.  If not set, a back reference to a nonexistent
  601.      subexpression is treated as literal characters.  */
  602. ! #define RE_NO_EMPTY_BK_REF (ONE << 13)
  603.   
  604.   /* If this bit is set, bracket expressions can't be empty.  
  605.      If it is set, they can be empty.  */
  606. ! #define RE_NO_EMPTY_BRACKETS (ONE << 14)
  607.   
  608.   /* If this bit is set, then *, +, ? and { cannot be first in an re or
  609.      immediately after a |, or a (.  Furthermore, a | cannot be first or
  610. --- 76,125 ----
  611.      If this bit is not set, special characters (such as *, ^, and $)
  612.      always have their special meaning regardless of the surrounding
  613.      context.  */
  614. ! #define RE_CONTEXT_INDEP_OPS (1 << 5)
  615.   
  616.   /* If this bit is not set, then \ before anything inside [ and ] is taken as 
  617.        a real \.
  618.      If set, then such a \ escapes the following character.  This is a
  619.        special case for awk.  */
  620. ! #define RE_AWK_CLASS_HACK (1 << 6)
  621.   
  622.   /* If this bit is set, then \{ and \} or { and } serve as interval operators.
  623.      If not set, then \{ and \} and { and } are treated as literals.  */
  624. ! #define RE_INTERVALS (1 << 7)
  625.   
  626.   /* If this bit is not set, then \{ and \} serve as interval operators and 
  627.        { and } are literals.
  628.      If set, then { and } serve as interval operators and \{ and \} are 
  629.        literals.  */
  630. ! #define RE_NO_BK_CURLY_BRACES (1 << 8)
  631.   
  632.   /* If this bit is set, then character classes are supported; they are:
  633.        [:alpha:],    [:upper:], [:lower:],  [:digit:], [:alnum:], [:xdigit:],
  634.        [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
  635.      If not set, then character classes are not supported.  */
  636. ! #define RE_CHAR_CLASSES (1 << 9)
  637.   
  638.   /* If this bit is set, then the dot re doesn't match a null byte.
  639.      If not set, it does.  */
  640. ! #define RE_DOT_NOT_NULL (1 << 10)
  641.   
  642.   /* If this bit is set, then [^...] doesn't match a newline.
  643.      If not set, it does.  */
  644. ! #define RE_HAT_NOT_NEWLINE (1 << 11)
  645.   
  646.   /* If this bit is set, back references are recognized.
  647.      If not set, they aren't.  */
  648. ! #define RE_NO_BK_REFS (1 << 12)
  649.   
  650.   /* If this bit is set, back references must refer to a preceding
  651.      subexpression.  If not set, a back reference to a nonexistent
  652.      subexpression is treated as literal characters.  */
  653. ! #define RE_NO_EMPTY_BK_REF (1 << 13)
  654.   
  655.   /* If this bit is set, bracket expressions can't be empty.  
  656.      If it is set, they can be empty.  */
  657. ! #define RE_NO_EMPTY_BRACKETS (1 << 14)
  658.   
  659.   /* If this bit is set, then *, +, ? and { cannot be first in an re or
  660.      immediately after a |, or a (.  Furthermore, a | cannot be first or
  661. ***************
  662. *** 140,160 ****
  663.      last in an re, or immediately follow another | or a (.  Also, a ^
  664.      cannot appear in a nonleading position and a $ cannot appear in a
  665.      nontrailing position (outside of bracket expressions, that is).  */
  666. ! #define RE_CONTEXTUAL_INVALID_OPS (ONE << 15)
  667.   
  668.   /* If this bit is set, then +, ? and | aren't recognized as operators.
  669.      If it's not, they are.  */
  670. ! #define RE_LIMITED_OPS (ONE << 16)
  671.   
  672.   /* If this bit is set, then an ending range point has to collate higher
  673.        or equal to the starting range point.
  674.      If it's not set, then when the ending range point collates higher
  675.        than the starting range point, the range is just considered empty.  */
  676. ! #define RE_NO_EMPTY_RANGES (ONE << 17)
  677.   
  678.   /* If this bit is set, then a hyphen (-) can't be an ending range point.
  679.      If it isn't, then it can.  */
  680. ! #define RE_NO_HYPHEN_RANGE_END (ONE << 18)
  681.   
  682.   
  683.   /* Define combinations of bits for the standard possibilities.  */
  684. --- 126,146 ----
  685.      last in an re, or immediately follow another | or a (.  Also, a ^
  686.      cannot appear in a nonleading position and a $ cannot appear in a
  687.      nontrailing position (outside of bracket expressions, that is).  */
  688. ! #define RE_CONTEXTUAL_INVALID_OPS (1 << 15)
  689.   
  690.   /* If this bit is set, then +, ? and | aren't recognized as operators.
  691.      If it's not, they are.  */
  692. ! #define RE_LIMITED_OPS (1 << 16)
  693.   
  694.   /* If this bit is set, then an ending range point has to collate higher
  695.        or equal to the starting range point.
  696.      If it's not set, then when the ending range point collates higher
  697.        than the starting range point, the range is just considered empty.  */
  698. ! #define RE_NO_EMPTY_RANGES (1 << 17)
  699.   
  700.   /* If this bit is set, then a hyphen (-) can't be an ending range point.
  701.      If it isn't, then it can.  */
  702. ! #define RE_NO_HYPHEN_RANGE_END (1 << 18)
  703.   
  704.   
  705.   /* Define combinations of bits for the standard possibilities.  */
  706. ***************
  707. *** 248,256 ****
  708.   /* 4.2 bsd compatibility.  */
  709.   extern char *re_comp (char *);
  710.   extern int re_exec (char *);
  711. - /* for GNU grep [tho] */
  712. - extern    LONG re_set_syntax (LONG syntax);
  713.   
  714.   #else /* !__STDC__ */
  715.   
  716. --- 234,239 ----
  717.